package Demo02.Demo06;

public class Demo_Waiter extends Thread {
    Demo_KFC Demo_kcf;
    //KFC要传入，保证每一个服务员和用户在同一个KFC对象内
    public Demo_Waiter(Demo_KFC Demo_kcf){
        this.Demo_kcf=Demo_kcf;

    }

    @Override
    public void run() {
        int size=(int)(Math.random()*5)+5;//每次生产的数量
        while (true){
            Demo_kcf.consu(size);//传入每次生产的数量
        }
    }
}


